import Route from '../route/Router'
declare var global:{
    gem_Route:any;
    controller:any;
}

//控制器的表示注解，用来生成控制器
export = async function controller(ctx,prefix:string){
    global.gem_Route = new Route({
        id          :   ctx.module.id,
        prefix      :   prefix || "",
        middleware  :   []
    });
    
    //清空
    global.controller={};
    //调用路由
    global.controller[ctx.module.id] = {prefix:prefix || (prefix==="/" ? "" : prefix)};
}